<script>
import a2 from './a2.vue';
import a3 from './a3.vue';
import a4 from './a4.vue';
const cObj = {
    a2, a3, a4
}
import Bus from '@/modules/fifty/views/c_b.js';
export default {
    name: 'bus',
    props: ['list'],
    methods: {
        save(val) {
            console.log(val);
        }
    },
    mounted() {
        Bus.$on('save', this.save)
    },
    beforeDestroy() {
        Bus.$off('save', this.save)
    },
    render(h) {
        return <div>
            {this.list.map((option) => {
                let C = cObj[option.cName]
                return <div>
                    <C></C>
                    {option.children && <a2 list={option.children}></a2>}
                </div>
            })}
            <span onClick={(e) => {
                e.stopPropagation();

                Bus.$emit('save', '123')
            }}>sadasd</span>
        </div>
    },
}
</script>